package com.wlyuan.open.scanner.utils.enums.transport.combine;

import com.wlyuan.core.marker.NamedValue;
import com.wlyuan.core.marker.NamedValueMap;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Map;

/**
 * @author lijing
 * @description 合单状态转换
 */
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
public enum CombineStatusEnum implements NamedValue<Integer> {

    /**
     * 待调度
     */
    WAIT_SCHEDULE(0, 10, "待调度"),
    /**
     * 已委托
     */
    DELEGATION(1, 20, "已委托"),
    /**
     *
     */
    OTHER(2, 30, "其他"),
    /**
     * 已关闭
     */
    CLOSED(32, 40, "已关闭");

    private final Integer value;
    private final Integer newValue;
    private final String name;

    private static final Map<Integer, CombineStatusEnum> MAP = new NamedValueMap<>(CombineStatusEnum.class);

    public static CombineStatusEnum fromValue(Integer value) {
        return MAP.get(value);
    }
}
